vskfandomcom-20200214-history
Virtual Skipper Wiki:List contents of an archive
Help! Some track files (see ) use special characters that get mapped to unexpected ASCII characters depending on the regional/language options specified. At least one extraneous comma is a problem but there may be other issues. If you are familiar with this problem and can suggest a more robust solution then please contact me at my talk page. -- najevi 09:34, 13 August 2009 (UTC) Why go through this hassle Race track .GBX files are tiny (<1kB) so bundle as many as you can into one ZIP archive and paste a comma-separated list of files into the Summary input box at the form. This will enable other members to use the search feature to locate whichever ZIP archive(s) contains a specific track description file. That list is easy enough to generate if you have access to a linux shell but can also be done at a DOS command line (a.k.a. Command Prompt) from within the Windows OS if you first install the completely free open source utility tools: * unzip * gawk This page details the steps to do just that under either linux or windows operating systems. How to .. produce a comma-separated list of files contained in a ZIP archive Suppose you have changed directory to a folder containing the ZIP archive of interest. * For this example we'll assume this is the directory of downloaded tracks ( %UserProfile%\My Documents\'Vsk5'\Tracks\Challenges\Downloaded ) and that the archive of interest is the file named: : My Tracks.zip Linux solution At a linux/unix shell prompt (easiest) type: # unzip -l My\ Tracks.zip |gawk 'BEGIN{FS=":"} ($2~/^01234567890123456789 .*\./){printf "%s, ",substr($2,6)} END{print ""}' > list.txt Noting that space characters in the filename are escaped using the backslash (\) character. Windows solution At a DOS command prompt (requires some initial setup) type: >unzip -l "My Tracks.zip"|gawk "BEGIN{FS=\":\"} ($2~/^01234567890123456789 .*\./) {printf \"%s, \",substr($2,6)} END{print \"\"}" > list.txt Notice how the DOS command prompt uses double quote character to * handle space characters in a filename * handle both outer and inner delimiters for the gawk script It's a confusing syntax so just trust the example given, copy and paste the line into a Command Prompt window and replace the "My Tracks.zip" name with whatever filename and you are good to go! If the above command line does not work for you then it simply means that the unzip and gawk commands have not yet been installed on your windows box. To install them: # Paste the following URLs into your browser address input field: #* http://gnuwin32.sourceforge.net/downlinks/gawk.php #* http://gnuwin32.sourceforge.net/downlinks/unzip.php # then, allow the download of #* gawk-3.1.6-1-setup.exe #* unzip-5.51-1.exe # then, run those two install files (as administrator) # After this initial setup retry the DOS command line given above. Paste the list into the upload form summary input box Whichever method is used the file list.txt will now contain a comma separated list of contents of your ZIP archive file. Copy and paste that list into the Summary: input box at either or .